﻿using System.ComponentModel;
using System.Xml.Serialization;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

using Tomahawk.Resources.Audio;

namespace Tomahawk.Processors
{
    [ContentProcessor(DisplayName = "Audio Bank Processor - Tomahawk Engine")]
    public class AudioBankContentProcessor : ContentProcessor<AudioBank, AudioBank>
    {
        public override AudioBank Process(AudioBank input, ContentProcessorContext context)
        {
            return input;
        }
    }

    [ContentTypeWriter]
    class AudioBankWriter : ContentTypeWriter<AudioBank>
    {
        protected override void Write(ContentWriter output, AudioBank value)
        {
            XmlSerializer x = new XmlSerializer(typeof(AudioBank));
            x.Serialize(output.BaseStream, value);
        }
        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return typeof(AudioBank).AssemblyQualifiedName;
        }
        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return "Tomahawk.Resources.Audio.AudioBankReader, " +
                "Tomahawk.Resources, Version=1.0.0.0, Culture=neutral";
        }
    }
}
